﻿// 开发者:micropu
// 公司:佛山远钧智慧科技有限公司

using BaiduBce.Util.Json.Example;
using SkiaSharp.Internals;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Admin.NET.Application.Entity;


/// <summary>
/// 项目
/// </summary>
[SugarTable("zj_Project", TableDescription = "项目")]
public class Project: EntityTenantBaseData
{
    /// <summary>
    /// 名称
    /// </summary>
    [SugarColumn(ColumnDescription = "名称",Length = 200)]
    public string Name { get; set; }

    /// <summary>
    /// 对接平台
    /// </summary>
    [SugarColumn(ColumnDescription = "对接平台")]
    public PlatformType Platform { get; set; }

    /// <summary>
    /// 服务器IP
    /// </summary>
    [SugarColumn(ColumnDescription = "服务器IP", Length = 20,DefaultValue = "",IsNullable = true)]
    public string ServerIP { get; set; }

    /// <summary>
    /// 服务器端口
    /// </summary>
    [SugarColumn(ColumnDescription = "服务器端口", Length = 20, DefaultValue = "" ,IsNullable = true)]
    public string ServerPort { get; set; }

    /// <summary>
    /// 厂家识别码
    /// </summary>
    [SugarColumn(ColumnDescription = "厂家识别码", Length = 50, DefaultValue = "", IsNullable = true)]
    public string ManufacturerId { get; set; }

    /// <summary>
    /// 是否强制同步人员
    /// </summary>
    [SugarColumn(ColumnDescription = "是否强制同步人员", DefaultValue = "false")]
    public bool QiangZhiSync { get; set; }

    /// <summary>
    /// 采集模式
    /// </summary>
    [SugarColumn(ColumnDescription = "采集模式", DefaultValue = "false")]
    public bool CaiJiMoShi { get; set; }

    /// <summary>
    /// 项目设备
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    [Navigate(NavigateType.OneToMany, nameof(Device.ProjectId))]
    public List<Device> Devices { get; set; } 

    /// <summary>
    /// 项目人员
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    [Navigate(NavigateType.OneToMany, nameof(Employee.ProjectId))]
    public List<Employee> Employees { get; set; } 

    /// <summary>
    /// 通行记录
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    [Navigate(NavigateType.OneToMany, nameof(UploadLog.ProjectId))]
    public List<UploadLog> UploadLogs { get; set; } 

    /// <summary>
    /// 设备通信日志
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    [Navigate(NavigateType.OneToMany, nameof(DevicesLog.ProjectId))]
    public List<DevicesLog> DevicesLogs { get; set; } 

    /// <summary>
    /// 平台通信日志
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    [Navigate(NavigateType.OneToMany, nameof(PlatformLog.ProjectId))]
    public List<PlatformLog> PlatformLogs { get; set; } 

    /// <summary>
    /// 状态（ 1启用 2停用）
    /// </summary>
    [SugarColumn(ColumnDescription = "状态",DefaultValue = "1")]
    public StatusEnum Status { get; set; } 
}
